home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / SPAWNO41.ARJ / SPAWNVPE.C < prev    next >
C/C++ Source or Header  |  1991-11-10  |  982b  |  33 lines

  1. /********************************************************************/
  2. /*   SPAWNO v4.0   EMS/XMS/disk swapping replacement for spawn...() */
  3. /*   (c) Copyright 1990, 1991 Ralf Brown  All Rights Reserved        */
  4. /*                                    */
  5. /*   May be freely copied provided that this copyright notice is    */
  6. /*   not altered or removed.                        */
  7. /********************************************************************/
  8.  
  9. #include "_spawno.h"
  10. #include <alloc.h>
  11.  
  12. int _Cdecl spawnvpeo(const char *overlay_path, const char *prog_name,
  13.              const char **args, const char **env)
  14. {
  15.    char *prog_path = __spawn_search(prog_name) ;
  16.  
  17.    if (prog_path)
  18.       {
  19.       int retval ;
  20.  
  21.       retval = __spawnv(overlay_path,prog_path,args,__spawn_buildenv(env)) ;
  22.       __spawn_free_env() ;
  23.       return retval ;
  24.       }
  25.    else
  26.       {
  27.       errno = ENOENT ;    /* path or filename not found */
  28.             /* _doserrno already set by __spawn_search() */
  29.       return -1 ;
  30.       }
  31. }
  32.  
  33.